// const LOGIN_API = '/api/Ecp.OnlineUser.apiLogin'
import {API_PRE, getApiJson, invoke} from './base'
// const localStorage = window.localStorage

const Register = {
  prepareEdit (pageCode, entityId) {
    let url = API_PRE + pageCode
    return getApiJson(url, {
      entityId: entityId
    })
  },
  prepareView (unitCode, entityId = null) {
    let url = API_PRE + 'HR.SAASCompany.Edit.vdp'
    return getApiJson(url, {
      unitCode: unitCode,
      entityId: entityId
    })
  },
  saveRegister (unitCode, data, args) {
    args = _.extend({data: data}, args)
    // console.log(args)
    let url = unitCode + '.save'
    return invoke(url, args)
  }
}
export {Register}
